package zoo.member.controller;

import java.util.HashMap;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import zoo.member.dao.MemberDao;
import zoo.member.domain.MemberCommand;



@Controller
public class MemberIdFindController {
	private static Log log=LogFactory.getLog(MemberIdFindController.class);
	
	@Autowired
	private MemberDao memberDao;

	@RequestMapping(value="/main/pwFind.do")
	public ModelAndView process(@RequestParam(value="keyWord",defaultValue="없어")String keyWord,
			@RequestParam(value="keyWord1",defaultValue="없어")String keyWord1)
		{
		if(log.isDebugEnabled()){	
			log.debug("keyWord:"+keyWord);
		}
		
		System.out.println("keyWord : " +keyWord);
		System.out.println("keyWord1 : " +keyWord1);
		
		//map객체 생성
		HashMap<String,Object>map= new HashMap<String,Object>();
		map.put("keyWord", keyWord);
		map.put("keyWord1", keyWord1);
		String id = null;
		
			id=memberDao.list2(map);
			System.out.println("list2 : " +id);
			
		//ModelAndView에 담아야함
		ModelAndView mav=new ModelAndView();
		mav.setViewName("user_popup/pwFind");
		mav.addObject("id",id);

		return mav;
		
	}
	
}
